package cn.itcast.exception;

import org.springframework.web.bind.annotation.ControllerAdvice;
import org.springframework.web.bind.annotation.ExceptionHandler;
import org.springframework.web.bind.annotation.ResponseBody;

/**
 * @author wgq
 * @date 2019-09-22 14:28
 */
@ControllerAdvice
public class MyException {

    @ExceptionHandler
    @ResponseBody
    public String xxx(Exception ex){
        return "发生错误了..错误信息是:"+ex.getMessage();
    }
}
